home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8147 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  67 lines

  1. Newsgroups: comp.lang.c,era.misc.software
  2. Path: ERA.COM!era!pumphrey
  3. From: pumphrey@ERA.COM (Mark Pumphrey)
  4. Subject: Turbo C to 80386 Assy Calling Problem
  5. Message-ID: <PUMPHREY.96Mar1172435@icarus.ERA.COM>
  6. Followup-To: comp.lang.c
  7. Sender: news@ERA.COM
  8. Organization: Engineering Research Associates, Vienna, VA
  9. Date: Fri, 1 Mar 1996 22:24:35 GMT
  10.  
  11. I am having a hard time building seperate objects from 
  12. assembler and c sources that can reference each other.
  13.  
  14. 1.  If I build using an object library, does not work...
  15.  
  16.     tasm get_cpx.asm, get_cpx.obj
  17.     Turbo Assembler Version 1.01
  18.  
  19.     tlib libcc.lib -+ get_cpx.obj
  20.     tlib 3.02
  21.  
  22.     tcc -v -lc -etest.exe test.c libcc.lib
  23.     Turbo C++ version 1.01
  24.  
  25.     Error: Undefined symbol _get_cpx in module test.c
  26.  
  27. 2.  If I build all at once, does work...
  28.  
  29.     tcc -v -etest.exe test.c get_cpx.asm
  30.  
  31. 3.  Source code...
  32.  
  33.     #define DECLARATIONS
  34.  
  35.     #include <stdio.h>      /* used for debugging */
  36.     #include "common.h"
  37.     extern int get_cpx();
  38.     main()
  39.     {
  40.         int i;
  41.  
  42.         i=get_cpx();
  43.         printf("i=%d\n",i);
  44.     }
  45.  
  46.                    .model small
  47.                    .code
  48.                    public _get_cpx
  49.     _get_cpx proc
  50.                    mov  ax,23
  51.                    ret
  52.                    _get_cpx endp
  53.                    end
  54.  
  55.  
  56. If anyone knows how to crack this puzzle, sure would
  57. help.  I tried contacting Borland but just got ignored.
  58.  
  59.  **************************************************************************
  60.   *    Name:     Mark Pumphrey                Room:       560            *
  61.    *   Company:  E-Systems Falls Church Div.  Phone:      703/734-8800  *
  62.     *  Address:  1595 Spring Hill Road        Extension:  8329         * 
  63.    *             Vienna, Virginia  22182      Fax:        703/734-8862  *
  64.   *    Email:    pumphrey@era.com             (A Raytheon Company)       *
  65.  **************************************************************************
  66.  
  67.